﻿using Base.FileDAL;

namespace Base.FileCollect.lmpl
{
    internal class UserPdfFileCollect : IUserPdfFileCollect
    {
        private readonly IUserPdfFileDAL _BasicDAL;

        public UserPdfFileCollect ( IUserPdfFileDAL basicDAL )
        {
            this._BasicDAL = basicDAL;
        }
        public long GetPdfFileId ( long fileId )
        {
            return this._BasicDAL.Get(a => a.FileId == fileId, a => a.PdfFileId);
        }
        public void Add ( long fileId, long pdfFileId )
        {
            if ( !this._BasicDAL.IsExist(c => c.FileId == fileId && c.PdfFileId == pdfFileId) )
            {
                this._BasicDAL.Add(fileId, pdfFileId);
            }
        }
    }
}
